<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>course</title>
</head>
<!-- 新 Bootstrap 核心 CSS 文件 -->
<link href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
<!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
<script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
<script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js">

</script>
<style>
    #nav-top1{
        position: relative;
        top: 10px;
    }
</style>
<body>
<div class="row" id="nav-top1">
    <%--新增书籍--%>
    <div class="col-md-1 column">
    </div>
    <div class="col-md-1 column">

    </div>
    <%--查找书籍--%>
    <div class="col-md-6 column">
        <form class="form-inline" action="${pageContext.request.contextPath}/course/queryName1" method="post">
            <div class="form-group">
                <input type="text" name="courseName" placeholder="请输入要查找的科目">
            </div>
            <button type="submit" class="btn btn-primary">查询</button>
        </form>
    </div>
    <%--查看全部--%>
    <div class="col-md-1 column">
        <a class="btn btn-primary" role="button" href="${pageContext.request.contextPath}/course/queryCourseByPage1">重置</a>
    </div>
    <div class="col-md-1 column">
    </div>

</div>
<div class="container-fluid" >
    <div class="row">
        <div class="col-md-1">
        </div>
        <div class="col-md-10">
            <div class="row clearfix">
                <div class="col-md-12 column">
                    <table class="table table-hover table-striped table-bordered ">
                        <thead>
                        <tr>
                            <th>课程编号</th>
                            <th>老师姓名</th>
                            <th>科目</th>
                            <th>选课人数</th>
                        </tr>
                        </thead>
                        <tbody>
                        <c:forEach var="course" items="${page.list}">
                            <tr>
                                <td>${course.id}</td>
                                <td>${course.teacher.name}</td>
                                <td>${course.subject}</td>
                                <td>${course.count}</td>
                            </tr>
                        </c:forEach>
                        </tbody>
                    </table>

                </div>
                <p style="text-align: center">
                    <c:choose>
                        <c:when test="${page.isFirstPage}">
                            首页&nbsp;
                            上一页&nbsp;
                        </c:when>
                        <c:otherwise>
                            <a href="${pageContext.request.contextPath}/course/queryCourseByPage1?page=${page.navigateFirstPage}">首页</a>
                            <a href="${pageContext.request.contextPath}/course/queryCourseByPage1?page=${page.prePage}">上一页</a>
                        </c:otherwise>
                    </c:choose>
                    <c:choose>
                        <c:when test="${page.isLastPage}">
                            下一页&nbsp;
                            尾页&nbsp;
                        </c:when>
                        <c:otherwise>
                            <a href="${pageContext.request.contextPath}/course/queryCourseByPage1?page=${page.nextPage}">下一页</a>
                            <a href="${pageContext.request.contextPath}/course/queryCourseByPage1?page=${page.navigateLastPage}">尾页</a>
                        </c:otherwise>
                    </c:choose>
                </p>
            </div>
        </div>
        <div class="col-md-1"></div>
    </div>
</div>
</div>



</body>

</html>
